package space.goldchen.kafka.kafka;


import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
/**
 * kafka消费者
 *
 * @author 2021
 * @create 2025-04-16 16:28
 */

@Service
@Slf4j
public class KafkaConsumer {
    /**
     * my-topic 消费者消费消息
     * @param message
     */
    @KafkaListener(topics = "my-topic", groupId = "my-consumer-group")
    public void consume(String message) {
        log.info("[my-topic]Received message: {}", message);
    }
}
